package com.ujiuye.dao;

import com.ujiuye.entity.UserInfo;

public class UserDao extends BaseDao<UserInfo>{
    //注册方法-->添加
    public int addUser(UserInfo u){
        String sql="insert into user(username,password,name,tel,sbir)values(?,?,?,?,?)";
        Object[] params = {u.getUsername(),u.getPassword(),u.getName(),u.getTel(),u.getBir()};
        return update(sql,params);
    }
    //查询  登录
    public UserInfo userLogin(String name,String password){
        String sql="select * from user where username=? and password=?";
        return queryOne(sql,UserInfo.class,name,password);
    }
}
